import request from '@/utils/request'

// 检测目标管理API
export const detectionTargetService = {
  // 获取检测目标列表
  getDetectionTargets: (params) => {
    return request({
      url: '/detection-targets',
      method: 'get',
      params
    }).then(response => response)
  },
  
  // 获取单个检测目标详情
  getDetectionTarget: (targetId) => {
    return request({
      url: `/detection-targets/${targetId}`,
      method: 'get'
    }).then(response => response)
  },
  
  // 创建检测目标
  createDetectionTarget: (data) => {
    return request({
      url: '/detection-targets',
      method: 'post',
      data
    }).then(response => response)
  },
  
  // 更新检测目标
  updateDetectionTarget: (targetId, data) => {
    return request({
      url: `/detection-targets/${targetId}`,
      method: 'put',
      data
    }).then(response => response)
  },
  
  // 删除检测目标
  deleteDetectionTarget: (targetId) => {
    return request({
      url: `/detection-targets/${targetId}`,
      method: 'delete'
    }).then(response => response)
  }
}